package org.deltaset.meta.faces;

import java.io.Serializable;
import java.util.logging.Logger;
import org.deltaset.meta.ExecutorResult;
import org.deltaset.meta.MetaActionExecutor;
import org.deltaset.meta.MetaEntry;

/**
 *
 * @author dmakariev
 */
class MetaEntryState implements Serializable {

    private static final Logger logger = Logger.getLogger(MetaEntryState.class.getName());
    private final MetaEntry metaEntry;
    private MetaActionExecutor finder;
    private MetaActionExecutor executor;
    private ExecutorResult executorResult;
    private Object model;
//    private String currentViewName;
//    private String lastViewName;

    public MetaEntryState(MetaEntry metaEntry) {
        this.metaEntry = metaEntry;
    }

    public MetaEntry getMetaEntry() {
        return metaEntry;
    }

//    public String getLastViewName() {
//        return lastViewName;
//    }
//
//    public String getCurrentViewName() {
//        return currentViewName;
//    }

//    public void setCurrentViewName(String viewName) {
//        if (null == viewName) {
//            return;
//        }
////        if(!viewName.equals("executeTemplate")){
////            this.lastViewName=currentViewName;
////        }
//        this.lastViewName = currentViewName;
//        currentViewName = viewName;
//    }

    public MetaActionExecutor getFinder() {
        return finder;
    }

    public MetaActionExecutor getExecutor() {
        return executor;
    }

    public ExecutorResult getExecutorResult() {
        return executorResult;
    }

    void setExecutor(final MetaActionExecutor executor) {
        this.executor = executor;
        ///////
        if (null != executor) {
            this.setExecutorResult(null);
        }
    }

    public Object getModel() {
        return model;
    }

    void setModel(final Object model) {
        this.model = model;
    }

    void setExecutorResult(final ExecutorResult executorResult) {
        this.executorResult = executorResult;
    }

    void setFinder(final MetaActionExecutor executor) {
        this.finder = executor;
    }
}
